﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type=text/css>
td{font-size:12;font-family:arial;text-align:center}
td.dt{font-size:11;font-family:arial;text-align:center}
a{color:blue}
a:hover{color:red}
a.bt{color:#888888}
</style>
<script language=javascript>
<!--    //
    var str = '', i, j, yy, mm, openbound, callback;
    var fld1, fld2, oImg;
    var wp = window.parent;
    var cf = wp.document.getElementById("CalFrame");
    var fld, curday;
    var today;
    //today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);
    //var lastyear=today.getYear(),lastmonth=today.getMonth();
    function parseDate(s) {
        var reg = new RegExp("[^0-9-]", "")
        if (s.search(reg) >= 0) return today;
        var ss = s.split("-");
        if (ss.length != 3) return today;
        if (isNaN(ss[0]) || isNaN(ss[1]) || isNaN(ss[2])) return today;
        return new Date(parseFloat(ss[0]), parseFloat(ss[1]) - 1, parseFloat(ss[2]));
    }
    function resizeCalendar() {

        cf.width = 144; cf.height = 192;

    }
    function initCalendar() {
        var Value = fld2.value;
        if (Value == "" || fld1.id == fld2.id) {
            today = new Date();
            today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0);
        }
        else {
            Value = fld2.value.split('-')
            var day = Value[2];
            var month = getMonth(Value[1]) - 1;
            var year = Value[0];
            today = new Date(year, month, day)
            //addDate('4',1,year+'/'+month+'/'+day);
            today.setDate(today.getDate() + 1);
            //  today=new Date(date.getFullYear(),date.getMonth(),date.getDate());
            today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0);
        }
        if (fld1 && fld1.value.length > 0) { curday = parseDate(fld1.value); }
        else if (fld2 && fld2.value.length > 0) { curday = parseDate(fld2.value); }
        else curday = today;

        drawCalendar(curday.getFullYear(), curday.getMonth());
    }
    function drawCalendar(y, m) {

        var x = new Date(y, m, 1), mv = x.getDay(), d = x.getDate(), de;
        yy = x.getFullYear(); mm = x.getMonth();
        document.getElementById("yyyymm").innerHTML = yy + "." + (mm + 1 > 9 ? mm + 1 : "0" + (mm + 1));
        for (var i = 1; i <= mv; i++) {
            de = document.getElementById("d" + i);
            de.innerHTML = "";
            de.bgColor = "";
        }
        while (x.getMonth() == mm) {

            de = document.getElementById("d" + (d + mv));
            if (x.getTime() == curday.getTime()) {

                de.bgColor = "#dddddd";
            }
            else
                de.bgColor = "white";
            if (x.getTime() == today.getTime())
                de.innerHTML = "<a href=javascript:setDate(" + d + ");><font color=red>" + d + "</font></a>";
            else if (x.getTime() < today.getTime())
                if (openbound) { de.innerHTML = "<a href=javascript:setDate(" + d + "); class=bt>" + d + "</a>"; }
                else { de.innerHTML = "<font color=#888888>" + d + "</font>"; }
            else
                de.innerHTML = "<a href=javascript:setDate(" + d + ");>" + d + "</a>";

            x.setDate(++d);
        }
        while (d + mv <= 42) {
            de = document.getElementById("d" + (d + mv));
            de.innerHTML = "";
            de.bgColor = "";
            d++;
        }
    }
    function setDate(d) {
        wp.hideCalendar();
        var Month = getMonth(mm + 1)
        var dstr = yy + "-" + (Month) + "-" + d;
        if (callback && callback.length > 0) { eval("wp." + callback + "(\"" + dstr + "\")"); }
        else { fld1.value = dstr; fld1.select(); }
    }
    function getMonth(mon) {
        if (mon == "1")
            return "Jan";
        if (mon == "2")
            return "Feb";
        if (mon == "3")
            return "Mar";
        if (mon == "4")
            return "Apr";
        if (mon == "5")
            return "May";
        if (mon == "6")
            return "Jun";
        if (mon == "7")
            return "Jul";
        if (mon == "8")
            return "Aug";
        if (mon == "9")
            return "Sep";
        if (mon == "10")
            return "Oct";
        if (mon == "11")
            return "Nov";
        if (mon == "12")
            return "Dec";

        if (mon == "Jan")
            return "1";
        if (mon == "Feb")
            return "2";
        if (mon == "Mar")
            return "3";
        if (mon == "Apr")
            return "4";
        if (mon == "May")
            return "5";
        if (mon == "Jun")
            return "6";
        if (mon == "Jul")
            return "7";
        if (mon == "Aug")
            return "8";
        if (mon == "Sep")
            return "9";
        if (mon == "Oct")
            return "10";
        if (mon == "Nov")
            return "11";
        if (mon == "Dec")
            return "12";
    }
//-->
</script>
</head>

<body topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 onLoad="resizeCalendar();" bgColor=white>
<table id=tbl0 bgColor=#7db6c7 border=0 cellpadding=1 cellspacing=0><tr><td>
<table width=100% border=0 cellpadding=2 cellspacing=1 bgcolor=white>
<tr bgcolor=#7db6c7>
<td width=16 id=prev><a href=javascript:drawCalendar(yy,mm-1);><img src="../images/prev.gif" border=0 width="16" height="16"></a></td>
<td width=99% id=yyyymm style=font-size:11;color:white></td>
<td width=16 id=next><a href=javascript:drawCalendar(yy,mm+1);><img src="../images/next.gif" border=0 width="16" height="16"></a></td>
</tr>
</table>
<table width=142 border=0 bgcolor=white cellpadding=0 cellspacing=2>
<tr height=18><td width=18><font color=red>7</font></td><td width=18>1</td><td width=18>2</td><td width=18>3</td><td width=18>4</td><td width=18>5</td><td width=18><font color=green>6</font></td></tr>
<tr height=1><td colspan=7 bgcolor=#7db6c7></td></tr>
<script language=javascript>
<!--    //
    for (i = 0; i < 6; i++) {
        str += "<tr height=18>";
        for (j = 1; j <= 7; j++) str += "<td id=d" + (i * 7 + j) + " class=dt ></td>";
        str += "</tr>";
    }
    document.write(str);
//-->
</script>
<tr height=1><td colspan=7 bgcolor=#7db6c7></td></tr>
<tr height=18>
  <td colspan=7><a href="javascript:wp.hideCalendar();">Close Window</a></td>
</tr>
</table>
</td></tr></table>
<script language=javascript>
<!--    //
    var bCalLoaded = true;
//-->
</script>
</body>
</html>